FROM nginx:stable-alpine
# 设置工作目录
WORKDIR /app

COPY ./dist /usr/share/nginx/html/

# 将自定义的 nginx 配置文件复制到容器中
COPY nginx.conf /etc/nginx/conf.d/default.conf

# 暴露容器的 80 端口
EXPOSE 80


##设置容器内的时区，如果不设置，默认时区是标准时间比北京时间晚8个小时
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories    
RUN  apk add tzdata
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo "Asia/Shanghai" > /etc/timezone && date


# 启动 nginx 服务
CMD ["nginx", "-g", "daemon off;"]